package com.gjh.study.algorithm4.evaluate;

public class OpsFactory {
    public static OpsHandler getOpsHandler(String name) {
        OpsHandler handler = null;
        switch (name) {
            case "+":
                handler = new PlusHandler();
                break;
            case "-":
                handler = new MinusHandler();
                break;
            case "*":
                handler = new MultiHandler();
                break;
            case "/":
                handler = new DivHandler();
                break;
            case "sqrt":
                handler = new SqrtHandler();
                break;
        }
        return handler;
    }
}
